<?php

/*
 * @author: Nguyen Anh Duc (anhduc.bkhn@gmail.com) 
 */

class ListNewsWidget extends CWidget {

    function run() {
        $criteria = new CDbCriteria();
        $criteria->condition = 'type=:type';
        $criteria->params = array(':type' => Posts::POST_TYPE_NEWS);

        $model = Posts::model()->findAll($criteria);

        $this->render('listnews', array(
            'model' => $model,
        ));
    }

}
?>

